hvmloader/pci: try to avoid placing BARs in RMRRs
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Wed, 22 Jul 2015 14:24:49 +0000 (15:24 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Thu, 23 Jul 2015 12:45:25 +0000 (13:45 +0100)
commitb730fc3e157a7b401305cecad7fcefee28340e2c
tree4c36bc8576df934e355282f306f6bff720e02845
parent07d73925eaa066c3ae2fb161246863e99e79d9f7
hvmloader/pci: try to avoid placing BARs in RMRRs

Try to avoid placing PCI BARs over RMRRs:

- If mmio_hole_size is not specified, and the existing MMIO range has
  RMRRs in it, and there is space to expand the hole in lowmem without
  moving more memory, then make the MMIO hole as large as possible.

- When placing RMRRs, find the next RMRR higher than the current base
  in the lowmem mmio hole.  If it overlaps, skip ahead of it and find
  the next one.

This certainly won't work in all cases, but it should work in a
significant number of cases.  Additionally, users should be able to
work around problems by setting mmio_hole_size larger in the guest
config.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Signed-off-by: Tiejun Chen <tiejun.chen@intel.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
tools/firmware/hvmloader/pci.c